package com.wteam.controller;


import com.wteam.PoJo.DTO.PageQuery;
import com.wteam.PoJo.VO.GoodsVO;
import com.wteam.PoJo.VO.ParamsVO;
import com.wteam.PoJo.VO.PresaleVO;
import com.wteam.Service.IPresaleService;
import com.wteam.until.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 预售表 前端控制器
 * </p>
 *
 * @author author
 * @since 2024-07-16
 */
@RestController
@RequestMapping("/presale")
@Api(tags = "商品模块")
public class PresaleController {
    @Autowired
    private IPresaleService iPresaleService;

    @ApiOperation(value = "查看预售商品")
    @PostMapping("/selectpresalegood")
    public Result<PresaleVO> presalegood(PageQuery pageQuery) {
        return  iPresaleService.selectpresalegood(pageQuery);
    }

    @ApiOperation(value ="根据id批量查预售商品（详细）")
    @GetMapping("/selectdetialgoods")
    public Result<List<ParamsVO>> selectdetialgoods(@ApiParam("预售商品id") @RequestParam List<Long>ids) {
        return  iPresaleService.selectgoods(ids);
    }



}
